<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>美嘉饲料</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="Expires" CONTENT="-1">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<link rel="stylesheet" href="/m/css/style.css">
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>m/js/common.js"></script>
<script type="text/javascript">
	$().ready(function(){
		var $cancel = $("#cancel");
		var id = $("#id").val();
		$cancel.click(function(){
			if(confirm("确定要去取消订单吗?")) {
				$.ajax({
					url: "<%=basePath%>member/order/cancel.shtml",
					type: "POST",
					data: {id: id},
					cache: false,
					beforeSend: function() {
						$cancel.prop("disabled", true);
					},
					success: function(data) {
						var success = data.success;
						if (success == "true") {
							alert("订单取消成功");
						} else {
							alert("订单取消失败");
						}
						location.reload(true);
					},
					complete: function() {
						$cancel.prop("disabled", false);
					}
				});
			}
			return false;
		});
	});
</script>
</head>
<body>
	<c:import url="/m/layouts/top.jsp" />
	<a name="top"></a>
	<!--header-->
	<header>
		<div class="header">
			<a href="/m/member/order/list.shtml" class="header-a-back"><span>返回</span></a>
			<a href="/m/index.html" class="header-a-home"><span>首页</span></a>
			<h2>订单详情</h2>
		</div>
	</header>
	<div class="clear10"></div>
	<div class="userdiv">
		<div class="orderlisttit">
			<input type="hidden" id="id" name="id" value="${order.id}"/>
			订单号：${order.sn }
		</div>
		<div class="orderdeatilbox clearfix">
			<div class="o_d_info">
				<p>
					订单状态：<em class="o_d_sign">${order.orderStatusLabel }</em>
				</p>
				<p>
					支付方式：<em>${order.paymentMethodName}</em>
				</p>
				<p>
					配送方式：<em>${order.shippingMethodName}</em>
				</p>
				<p>
					下单时间：<em><fmt:formatDate value="${order.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></em>
				</p>
			</div>
		</div>
	</div>
	<div class="userdiv">
		<div class="orderlisttit">商品详情</div>
		<c:forEach items="${order.orderItems }" var="orderItem">
			<div class="orderlistdiv clearfix">
				<div class="o_d_info">
					<a href="/m/product.html" class="order-de"> <img src="/m/images/pro1.png"
						class="pro-d">
						<div class="cart_orderlist_info">
							<p>${orderItem.name }</p>
							<p>
								价格：<span class="fontred">￥<fmt:formatNumber value="${orderItem.price }" pattern="0.00"/></span>
							</p>
							<p>
								<em>数量：<fmt:formatNumber value="${orderItem.quantity }" pattern="0"/></em>&nbsp;&nbsp;<em>小计:￥<fmt:formatNumber value="${orderItem.subtotal }" pattern="0.00"/></em>
							</p>
						</div>
					</a>
				</div>
			</div>
		</c:forEach>
	</div>
	<div class="userdiv">
		<div class="orderlisttit">收货信息</div>
		<div class="orderdeatilbox clearfix">
			<div class="o_d_info">
				<p>
					收货人：<em>${order.consignee }</em>
				</p>
				<p>
					手机：<em>${order.phone }</em>
				</p>
				<p>
					地址：<em>${order.address }</em>
				</p>
				<p>
					邮编：<em>${order.zipCode }</em>
				</p>
				<p>
					发票抬头：<em>${order.invoiceTitle }</em>
				</p>
			</div>
		</div>
	</div>
	<div class="userdiv">
		<div class="orderlisttit">价格详情</div>
		<div class="orderdeatilbox clearfix">
			<div class="o_d_info">
				<p>
					商品总金额：<em>￥<fmt:formatNumber value="${order.amount}" pattern="0.00"/></em>
				</p>
				<p>
					运费：<em>￥0.00</em>
				</p>
				<p>
					订单应付金额：<span class="orred">￥<fmt:formatNumber value="${order.amount}" pattern="0.00"/></span>
				</p>
			</div>
		</div>
	</div>
	<c:import url="/m/layouts/foot.jsp" />
</body>
</html>
